home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir36 / ismouse.zip / ISMOUSE.ASM < prev    next >
Assembly Source File  |  1994-09-19  |  1KB  |  42 lines

  1. ; To detect a mouse and return an ERRORLEVEL in batch
  2. ; ERRORLEVEL == 0 -- no mouse
  3. ; ERRORLEVEL == 1 -- mouse
  4. ;
  5. ;
  6. ; modeled after code by:
  7. ;  Written by  Tom Gilbert - May, 1991 (MOUSRPT1.ZIP)
  8. ;  Modification by W. Curtiss Priest
  9. ;  Center for Information, Technology & Society
  10. ;  466 Pleasant Street
  11. ;  Melrose, MA  02176
  12. ;  617-662-4044
  13. ;
  14. ;
  15. ;
  16. ;
  17. ;
  18. cseg     segment public byte 'CODE'
  19.      assume  cs:cseg, ds:cseg, es:nothing
  20.      org     100h
  21. ComEntry proc near                      ; program begins
  22.     jmp Start
  23.     db 13,'CITS Mouse Detector',26
  24.  
  25. NoFind: mov  al,00h                     ; return code, mouse not found
  26.     jmp  ShoOff                     ; and Return to MS-DOS
  27. ;
  28. Start:  mov  ax,3533h                   ; Get Mouse Interrupt Address
  29.     int  21h                        ; es:bx == segment:offset of handler
  30.     mov  ax,es                      ; Copy Segment for Test
  31.     or   ax,bx                      ; If address UNassigned (es:0, bx:0)
  32.     jz   NoFind                     ; Then "Mouse not installed"
  33.     xor  ax,ax
  34.     int  33h                        ; Reset Mouse Driver and
  35.     inc  ax                         ; If NOT a Minus 1 Return
  36.     jnz  NoFind                     ; Then "Mouse not installed"
  37.     mov  al,01h                     ; return code, found mouse
  38. ShoOff: mov  ah,4ch                     ; terminate with return code
  39.     int  21h                        ; terminate
  40. cseg            ends
  41.         end     ComEntry
  42.